
void outputController(){
  if(~((system_info_marker>>3)&0x1)){     //电池未在保护状态时才可开启
    switch(system_output_control_mode){
      case 0:     //0-普通模式      
        if(digitalRead(ESP_PIN_OUTPUT)!=system_output_state){
          digitalWrite(ESP_PIN_OUTPUT, system_output_state);
          SaveSettings();
        }
        break;
      case 1:     //1-光控模式
        controlBySunlight();
        digitalWrite(ESP_PIN_OUTPUT, system_output_state);
        break;
      case 2:     //2-光控+时控
        controlBySunlight();
        //计时算法
        if(esp_ouput_open_millis==0&&system_output_state==0){
          esp_ouput_open_millis = millis();
        }
        if(((millis()-esp_ouput_open_millis)%86400000)/3600000 >= system_output_optical_control_time){
          esp_ouput_open_millis = 0;
          system_output_state = 1;
        }
        digitalWrite(ESP_PIN_OUTPUT, system_output_state);
        break;
    }
  }
  
}
//光线控制算法
void controlBySunlight(){
  if(system_ina_voltage_1 < system_light_control_openv){
    system_output_state = 0;
  }else{
    system_output_state = 1;
  }
}